<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFeishuCallingCardsArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feishu_calling_cards_articles', function (Blueprint $table) {
            $table->id();
            $table->unsignedTinyInteger('type')->default(0)->comment('类型，1-加盟说，2-品牌介绍');
            $table->string('name', 32)->default('')->comment('标题');
            $table->string('content', 255)->default('')->comment('内容');
            $table->string('originalImage', 120)->default('')->comment('原始大图');
            $table->string('thumbImage', 120)->default('')->comment('预览图');
            $table->string('url', 255)->default('')->comment('跳转网址');
            $table->unsignedInteger('weight')->default(100)->comment('权重，越大越靠前');
            $table->unsignedTinyInteger('status')->default(0)->comment('0-无效，1-有效');
            $table->json('extra')->comment('额外数据，json字符串');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '加盟说、品牌介绍内容列表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('feishu_calling_cards_articles');
    }
}
